package com.cqc.searchviewdemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;

/**
 * Created by ${cqc} on 2016/10/31.
 */

public class NewActivity extends AppCompatActivity {

    private ImageView iv;
    private Toolbar toolbar;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new);
        initToolbar();

        initImageView();
    }

    private void initImageView() {
        iv = (ImageView) findViewById(R.id.imageView_activity_new);
        //设置过度动画
        ViewCompat.setTransitionName(iv,"transition");
    }

    private void initToolbar() {
        toolbar = (Toolbar) findViewById(R.id.toolbar_actiivty_new);

        setSupportActionBar(toolbar);
        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);//显示toolbar的导航图标
    }
}
